package bookstore.model;

import java.io.Serializable;
import java.util.Objects;

public class OrderItemPK implements Serializable {
    private Long orderid;
    private Book book;

    public Long getOrderid() {
        return orderid;
    }

    protected void setOrderid(Long orderid) {
        this.orderid = orderid;
    }

    public Book getBook() {
        return book;
    }

    protected void setBook(Book book) {
        this.book = book;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderItemPK that = (OrderItemPK) o;
        return Objects.equals(orderid, that.orderid) &&
                Objects.equals(book, that.book);
    }

    @Override
    public int hashCode() {

        return Objects.hash(orderid, book);
    }
}
